﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Panel.aspx.cs" Inherits="InformationSystem.WebSite.Panel" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>信息中心</title>
    <link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
    <link rel="Stylesheet" type="text/css" href="css/jquery-ui-1.7.1.custom.css" />
    <!--[if IE 7]><link rel="stylesheet" href="css/ie.css" type="text/css" media="screen, projection" /><![endif]-->
    <!--[if IE 6]><link rel="stylesheet" href="css/ie6.css" type="text/css" media="screen, projection" /><![endif]-->
    <link rel="stylesheet" type="text/css" href="css/markitup/style.css" />
    <link rel="stylesheet" type="text/css" href="css/markitup/default/style.css" />
    <link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen" />
    <!--[if IE]>
		<style type="text/css">
		  .clearfix {
		    zoom: 1;     /* triggers hasLayout */
		    display: block;     /* resets display for IE/Win */
		    }  /* Only IE can see inside the conditional comment
		    and read this CSS rule. Don't ever use a normal HTML
		    comment inside the CC or it will close prematurely. */
		</style>
	<![endif]-->
    <!-- JavaScript -->
    <script type="text/javascript" src="Scripts/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="Scripts/jquery-ui-1.7.1.custom.min.js"></script>
    <script type="text/javascript" src="Scripts/hoverIntent.js"></script>
    <script type="text/javascript" src="Scripts/superfish.js"></script>
    <script type="text/javascript">
        // initialise plugins
        jQuery(function () {
            jQuery('ul.sf-menu').superfish();
        });

    </script>
    <script type="text/javascript" src="Scripts/excanvas.pack.js"></script>
    <script type="text/javascript" src="Scripts/jquery.flot.pack.js"></script>
    <script type="text/javascript" src="Scripts/jquery.markitup.pack.js"></script>
    <script type="text/javascript" src="Scripts/set.js"></script>
    <script type="text/javascript" src="Scripts/custom.js"></script>
    <script type="text/javascript">
        function popupUri(uri, width, height) {
            //mywindow.AutoLoad.url = "www.baidu.com"
            //mywindow.AutoLoad.MOde = LoadMode.IFrame;
            mywindow.clearContent();
            mywindow.setWidth(width);
            mywindow.setHeight(height);
            mywindow.center();
            mywindow.show();
            mywindow.load(uri)
        }
        function resetContent() {
            mywindow.clearContent();
        }

        function ResizeFrameHeight(height) {
            var ff = document.getElementById("fr");
            PFR.setHeight(height + 10);

        }
        function menuopenUri(uri) {
            //var ff = document.getElementById("fr");
            //ff.src = uri;
            //ff.style.display = '';
            PFR.load(uri);
            PFR.show();
            var main = document.getElementById("defaultContent");
            main.style.display = 'none';
        }
        function menushowdefault() {
            //关闭iframe
            //var ff = document.getElementById("fr");
            //ff.src = '';
            //ff.style.display = 'none';
            PFR.hide();
            var main = document.getElementById("defaultContent");
            main.style.display = '';
        }
        function myinit() {
            var uri = document.getElementById('hdnuri');
            if (uri.value == '') return;
            menuopenUri(uri.value);
            //student
            var evt = document.createEvent("MouseEvents");
            evt.initEvent("click", true, true);
            document.getElementById(document.getElementById('hdnm').value).dispatchEvent(evt);
            //For IE only
            //document.getElementById(document.getElementById('hdnm').value).click();
        }

        function updatecount(response, result) {
            var text = response;
            var responseArray = Ext.util.JSON.decode(result.responseText);
            document.getElementById('online').firstChild.textContent = "在线人数:" + responseArray.count;
        }
    </script>
    <!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.pack.js"></script><![endif]-->
</head>
<body>
    <form runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server">
        <Listeners>
            <DocumentReady Handler="myinit()" />
        </Listeners>
    </ext:ResourceManager>
    <div class="container" id="container">
        <div id="header">
            <div id="profile_info">
                <img src="img/avatar.jpg" id="avatar" alt="avatar" onclick="window.location.href='Panel.aspx'"
                    style="cursor: pointer" />
                <p>
                    欢迎<a style="margin-left: 4px; margin-right: 10px" href="Panel.aspx"><%=user.UserName%></a><a
                        style="margin-right: 2px" href="Panel.aspx">设置</a></p>
                <p id="online" style="margin-top: 2px">
                    在线人数:0 <a style="margin-left: 5px;" href="javascript:void(0)" onclick="popupUri('Module/SecurityMgr/passwordchange.aspx',300,200)">
                        修改密码</a><a style="margin-left: 5px;" href="javascript:void(0)" onclick="window.location.href='Logout.aspx'">注销</a>
                </p>
                <p class="last_login" id="lastlogintime" runat="server">
                </p>
            </div>
            <div id="logo">
                <h1>
                    <a href="/"></a>
                </h1>
            </div>
        </div>
        <!-- end header -->
        <div id="content">
            <div id="top_menu" class="clearfix">
                <a href="Default.aspx" id="visit" class="right">返回首页</a>
            </div>
            <div id="content_main" class="clearfix">
                <div id="main_panel_container" class="right">
                    <div id="dashboard">
                        <%--  <iframe id="fr" width="100%" style="display: none; "></iframe>--%>
                        <ext:Panel runat="server" ID="PFR" Layout="ContainerLayout" Hidden="true" BodyBorder="false">
                            <AutoLoad Mode="IFrame" ShowMask="true" MaskMsg="正在加载页面，请稍后...">
                            </AutoLoad>
                        </ext:Panel>
                        <div id="defaultContent">
                            <h2 class="ico_information">
                                信息概要</h2>
                            <div class="clearfix">
                                <div class="left quickview">
                                    <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Admin) %>
                                    <%{ %>
                                    <h3>
                                        系统数据</h3>
                                    <ul>
                                        <li>自上次启动，系统运行时间: <span class="number" id="lastsys" runat="server"></span></li>
                                        <li>自上次启动，系统访问量: <span class="number" id="lastvisited" runat="server"></span></li>
                                        <li>学生/(家长)数量: <span class="number" id="totalstucount" runat="server"></span></li>
                                        <li>教职员数量: <span class="number" id="totalasscount" runat="server"></span></li>
                                    </ul>
                                    <%}
                                      else if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Assistant)
                                      {%>
                                    <h3>
                                        年级信息</h3>
                                    <ul>
                                        <li>辅导员人数: <span class="number" id="asscount" runat="server"></span></li>
                                        <li>已发布公告数量: <span class="number" id="pubinfocount" runat="server"></span></li>
                                        <li>学生/(家长)数量: <span class="number" id="gradestucount" runat="server"></span></li>
                                        <li>是否拥有院系论坛: <span class="number" id="forum" runat="server"></span></li>
                                    </ul>
                                    <%}
                                      else if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Student || CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Parent)
                                      {%>
                                    <h3>
                                        院系状态</h3>
                                    <ul>
                                        <li>辅导员: <span class="number" id="assname" runat="server"></span></li>
                                        <li>年级学生数量: <span class="number" id="gradestucountforparent" runat="server"></span>
                                        </li>
                                        <li>当前学期：<span class="number" id="currentterm" runat="server"></span></li>
                                    </ul>
                                    <%} %>
                                </div>
                                <div class="quickview left">
                                    <h3>
                                        今日数据</h3>
                                    <ul>
                                        <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Admin) %>
                                        <%{ %>
                                        <li>在线用户数量: <span class="number" id="onlineusercount" runat="server"></span></li>
                                        <li>今日访问量: <span class="number" id="todayvisited" runat="server"></span></li>
                                        <li>
                                            <br />
                                        </li>
                                        <li>
                                            <br />
                                        </li>
                                        <%}
                                          else if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Assistant)
                                          { %>
                                        <li>年级在线用户数量: <span class="number" id="deponlinecount" runat="server"></span></li>
                                        <li>论坛新增主题: <span class="number" id="newthread" runat="server"></span></li>
                                        <li>论坛新增回复: <span class="number" id="newreply" runat="server"></span></li>
                                        <li>
                                            <br />
                                        </li>
                                        <%}
                                          else if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Student || CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Parent)
                                          {%>
                                        <li>年级在线学生用户数量: <span class="number" id="gradeonlinestu" runat="server"></span></li>
                                        <li>年级在线家长用户数量: <span class="number" id="gradeonlineparent" runat="server"></span>
                                        </li>
                                        <li>在线辅导员: <span class="number" id="gradeass" runat="server"></span></li>
                                        <%} %>
                                    </ul>
                                </div>
                                <%--<div id="chart" class="left">
                                    <h3>
                                        更多...</h3>
                                    <div id="placeholder">
                                    </div>
                                    <!-- CHART -->
                                    <a href="#" class="ico_chart more">点击查阅详细信息</a>
                                </div>--%>
                            </div>
                        </div>
                    </div>
                    <!-- end #dashboard -->
                    <div id="shortcuts" class="clearfix">
                        <h2 class="ico_shortcut">
                            快速功能选项</h2>
                        <ul>
                            <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Admin)
                              {%>
                            <li class="first_li"><a href="#" onclick="menuopenUri('Module/SysMgr/SysMgrPlus.aspx')">
                                <img src="img/system.png" alt="系统" /><span>系统</span></a></li>
                            <li><a href="#" onclick="openUri('dd')">
                                <img src="img/statistic.png" alt="statistics" /><span>信息统计</span></a></li>
                            <li><a href="#">
                                <img src="img/forum.png" alt="论坛管理" /><span>论坛管理</span></a></li>
                            <%} %>
                            <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Admin || CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Assistant)
                              {%>
                            <li><a href="#" onclick="popupUri('UtilityPage/SimpleDataImport.aspx',600,350)">
                                <img src="img/datachange.png" alt="数据交换" /><span>数据交换</span></a></li>
                            <li><a href="#" onclick="popupUri('Module/NoticeMgr/CreateNew.aspx?m=publicinfo',750,500)">
                                <img src="img/announcement.png" alt="公告" /><span>发公告</span></a></li>
                            <%} %>
                            <li><a href="#" onclick="popupUri('Module/NoticeMgr/CreateNew.aspx?m=mail',750,500)">
                                <img src="img/mail.png" alt="Comments" /><span>写邮件</span></a></li>
                            <%--                           
                            --%>
                            <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Student || CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Parent)
                              {%>
                            <li><a href="#" onclick="menuopenUri('Module/StuMgr/StuMark.aspx')">
                                <img src="img/gallery.jpg" alt="Gallery" /><span>学业信息</span></a></li>
                            <%} %>
                            <li><a href="#" onclick="popupUri('Module/SecurityMgr/passwordchange.aspx',350,200)">
                                <img src="img/security.jpg" alt="Security" /><span>密码安全</span></a></li>
                        </ul>
                    </div>
                    <!-- end #shortcuts -->
                </div>
                <div id="sidebar" class="left">
                    <div style="cursor: pointer;" onclick="menushowdefault()">
                        <h2 class="ico_home">
                            学生事务服务系统</h2>
                    </div>
                    <ul id="menu">
                        <li>
                            <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Admin) %>
                            <%{ %>
                            <a style="cursor: pointer" class="ico_system" id="systemreg">系统</a>
                            <ul>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/SysMgr/SysMgrMain.aspx')">
                                        <a>系统注册</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/SysMgr/SysMgrPlus.aspx')">
                                        <a>系统清理</a></div>
                                </li>
                            </ul>
                            <a style="cursor: pointer" class="ico_manu">基础数据维护</a>
                            <ul>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/AuthorityMgr/SysUserMgr.aspx')">
                                        <a>用户管理</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/AuthorityMgr/Department.aspx')">
                                        <a>院系信息管理</a></div>
                                </li>
                                <%--      <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/AuthorityMgr/Major.aspx')">
                                        <a>专业信息管理</a></div>
                                </li>--%>
                            </ul>
                            <%} %>
                            <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Assistant || CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Student || CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Parent) %>
                            <%{ %>
                            <a id="student" style="cursor: pointer" class="ico_user">学生信息</a>
                            <ul>
                                <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Assistant) %>
                                <%{ %>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/StuMgr/ClassMgr.aspx')">
                                        <a>班级信息维护</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/StuMgr/StuMgr.aspx')">
                                        <a>学生信息维护</a></div>
                                </li>
                                <%}
                                  else
                                  { %>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/StuMgr/PersonInf.aspx')">
                                        <a>个人基本信息查询</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/StuMgr/StuMark.aspx')">
                                        <a>学业信息查询</a></div>
                                </li>
                                <%} %>
                            </ul>
                            <%} %>
                            <a id="mail" class="ico_mail" style="cursor: pointer">站内信</a>
                            <ul>
                                <li>
                                    <div style="cursor: pointer;" onclick="popupUri('Module/NoticeMgr/CreateNew.aspx?m=mail',750,500)">
                                        <a>写邮件</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/MailMgr/MailIn.aspx')">
                                        <a>收件箱</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/MailMgr/MailOut.aspx')">
                                        <a>已发邮件</a></div>
                                </li>
                                <%--<li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/MailMgr/MailDraft.aspx')">
                                        <a>草稿箱</a></div>
                                </li>--%>
                            </ul>
                            <a id="information" class="ico_msg" style="cursor: pointer">消息管理</a>
                            <ul>
                                <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Admin || CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Assistant) %>
                                <%{ %>
                                <li>
                                    <div style="cursor: pointer;" onclick="popupUri('Module/NoticeMgr/CreateNew.aspx?m=msg',750,500)">
                                        <a>信息发布</a></div>
                                </li>
                                <%} %>
                                <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Assistant || CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Student || CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Parent)
                                  { %>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/NoticeMgr/WorkInfMgr.aspx')">
                                        <a>就业信息</a></div>
                                </li>
                                <%}%>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/NoticeMgr/AfficheMgr.aspx')">
                                        <a>公告</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/NoticeMgr/MessageMgr.aspx')">
                                        <a>消息</a></div>
                                </li>
                            </ul>
                            <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Admin || CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Assistant) %>
                            <%{ %>
                            <a style="cursor: pointer" class="ico_forum">论坛管理</a>
                            <ul>
                                <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Admin) %>
                                <%{ %>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/ForumMgr/functionSetup.aspx')">
                                        <a>功能管理</a></div>
                                </li>
                                <%}
                                  else
                                  {%>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/ForumMgr/InformationApprove.aspx')">
                                        <a>信息审核</a></div>
                                </li>
                                <%} %>
                            </ul>
                            <%} %>
                            <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Assistant) %>
                            <%{ %>
                            <a id="document" style="cursor: pointer" class="ico_document">文件管理</a>
                            <ul>
                                <li>
                                    <div style="cursor: pointer;" onclick="popupUri('Module/DocumentMgr/DocumentUpload.aspx',500,200)">
                                        <a>上传新文件</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="menuopenUri('Module/DocumentMgr/DocumentEdit.aspx')">
                                        <a>文件资源</a></div>
                                </li>
                            </ul>
                            <%} %>
                            <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Assistant) %>
                            <%{ %>
                            <a style="cursor: pointer" class="ico_data">数据交换</a>
                            <ul>
                                <li>
                                    <div style="cursor: pointer;" onclick="popupUri('UtilityPage/SimpleDataImport.aspx?m=0',600,350)">
                                        <a>学生信息导入</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="popupUri('UtilityPage/SimpleDataImport.aspx?m=1',600,350)">
                                        <a>学生成绩导入</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="javascript:alert('即将推出')">
                                        <a>学生信息导出</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="javascript:alert('即将推出')">
                                        <a>学生成绩导出</a></div>
                                </li>
                                <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Admin) %>
                                <%{ %>
                                <li>
                                    <div style="cursor: pointer;" onclick="javascript:alert('即将推出，敬请期待！')">
                                        <a>数据库备份</a></div>
                                </li>
                                <%} %>
                            </ul>
                            <%} %>
                            <a style="cursor: pointer" class="ico_security">安全</a>
                            <ul>
                                <li>
                                    <div style="cursor: pointer;" onclick="popupUri('Module/SecurityMgr/passwordchange.aspx',350,200)">
                                        <a>登录密码修改</a></div>
                                </li>
                                <%if (CurrentUserType == InformationSystem.BLL.Core.Model.UserType.Admin) %>
                                <%{ %>
                                <li>
                                    <div style="cursor: pointer;" onclick="javascript:alert('即将推出，敬请期待！')">
                                        <a>用户密码重置</a></div>
                                </li>
                                <li>
                                    <div style="cursor: pointer;" onclick="javascript:alert('即将推出，敬请期待！')">
                                        <a>登录信息查阅</a></div>
                                </li>
                                <%} %>
                            </ul>
                        </li>
                    </ul>
                </div>
                <!-- end #sidebar -->
            </div>
            <!-- end #content_main -->
            <%-- <div id="dialog" title="Welcome">
                <p>
                    Thank you for stopping by :) Hope you like that theme.</p>
            </div>--%>
            <!-- end #dialog [if you don't want this, delete whole div and 6th line i custom.js -->
        </div>
        <!-- end #content -->
        <div id="footer" class="clearfix">
            <p class="left">
                Power by 3161140 672598722</p>
            <p class="right">
                © 2012 NJUST, Some Rights Reserved.
            </p>
        </div>
        <!-- end #footer -->
    </div>
    <!-- end container -->
    <ext:Window runat="server" ID="mywindow" Width="600" Height="350" Hidden="true" Layout="FitLayout"
        Modal="true">
        <AutoLoad ShowMask="true" Mode="IFrame" MaskMsg="正在加载页面，请稍后...">
        </AutoLoad>
        <%--<Listeners>
            <Hide Handler="resetContent()" />
        </Listeners>--%>
    </ext:Window>
    <ext:TaskManager runat="server" ID="taskmgr">
        <Tasks>
            <ext:Task TaskID="getusercountprogress" AutoRun="true">
                <DirectEvents>
                    <Update Url="UserOnline.aspx" Complete="updatecount(response,result)" Method="GET"
                        Delay="2000">
                    </Update>
                </DirectEvents>
            </ext:Task>
        </Tasks>
    </ext:TaskManager>
    <input type="hidden" name="hdnuri" id="hdnuri" value="" runat="server" />
    <input type="hidden" name="hdnm" id="hdnm" runat="server" />
    </form>
</body>
</html>
